
class entry(object):

    VERBS = ["Clear"]

    def incoming(self, event):
        child = self.fetch(event)
        data = event.data
        if len(data) == 1: data = data[0]
        event.window.manipulate(child, lambda x: setattr(x, 'caption', str(data)))

    def realize(self, event):
        child = self.fetch(event)

    def verb(self, event):
        child = self.fetch(event)
        event.window.manipulate(child, lambda x: setattr(x, 'caption', "Hi there"))
    
    def fetch(self, event):
        for x in event.shape.xref:
            for y in x().xref:
                child = y()
                if isinstance(child, event.window.Label):
                    return child
